<div mat-dialog-content>
    <form #VendorForm="ngForm">
        <mat-form-field>
            <input matInput type="text" [(ngModel)]="data.v3401" name="v3401" placeholder="廠商代號" required [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput type="text" [(ngModel)]="data.v3402" name="v3402" placeholder="廠商名稱" [readonly]="ReadOnly">
        </mat-form-field>
        <br>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3403" name="v3403" placeholder="簡稱" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3419" name="v3419" placeholder="廠商等級" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <mat-select [(ngModel)]="data.v3405" placeholder="廠商區分" name="v3405" [disabled]="ReadOnly">
                <mat-option [value]="1">
                    供應商
                </mat-option>
                <mat-option [value]="2">
                    其他
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3424" name="v3424" placeholder="廠商類別" [readonly]="ReadOnly">
        </mat-form-field>
        <br>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3416" name="v3416" placeholder="國別" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3409" name="v3409" placeholder="地區別" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3417" name="v3417" placeholder="幣別" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <mat-select [(ngModel)]="data.v3427" placeholder="付款方式" name="v3427" [disabled]="ReadOnly">
                <mat-option [value]="1">
                    月結
                </mat-option>
                <mat-option [value]="2">
                    貨到
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field>
            <input matInput type="number" [(ngModel)]="data.v3428" name="v3428" placeholder="付款天數" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput type="number" [(ngModel)]="data.v3432" name="v3432" placeholder="結帳日數" [readonly]="ReadOnly">
        </mat-form-field>
        <br>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3408" name="v3408" placeholder="統一編號" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <mat-select [(ngModel)]="data.v3430" placeholder="課稅別" name="v3430" [disabled]="ReadOnly">
                <mat-option [value]="1">
                    應稅
                </mat-option>
                <mat-option [value]="2">
                    零稅
                </mat-option>
                <mat-option [value]="3">
                    免稅
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field>
            <mat-select [(ngModel)]="data.v3431" placeholder="發票種類" name="v3431" [disabled]="ReadOnly">
                <mat-option [value]="1">
                    三聯電子
                </mat-option>
                <mat-option [value]="2">
                    三聯收銀機
                </mat-option>
                <mat-option [value]="3">
                    二聯
                </mat-option>
                <mat-option [value]="4">
                    免開發票
                </mat-option>
            </mat-select>
        </mat-form-field>
        <br>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3433" name="v3433" placeholder="匯款銀行" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3434" name="v3434" placeholder="匯款帳號" [readonly]="ReadOnly">
        </mat-form-field>

        <mat-divider></mat-divider>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3412" name="v3412" placeholder="Tel No." [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3413" name="v3413" placeholder="Fax No." [readonly]="ReadOnly">
        </mat-form-field>
        <br>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3415" name="v3415" placeholder="Mobile No." [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput type="email" [(ngModel)]="data.v3414" name="v3414" placeholder="Email" [readonly]="ReadOnly">
        </mat-form-field>
        <br>
        
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3425" name="v3425" placeholder="Tel1 No." [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3426" name="v3426" placeholder="Tel2 No." [readonly]="ReadOnly">
        </mat-form-field>
        <br>
        
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3407" name="v3407" placeholder="聯絡人" [readonly]="ReadOnly">
        </mat-form-field>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3406" name="v3406" placeholder="負責人" [readonly]="ReadOnly">
        </mat-form-field>

        <mat-divider></mat-divider>

        <mat-form-field>
            <input matInput [(ngModel)]="data.v3420" name="v3420" placeholder="公司地址" [readonly]="ReadOnly">
        </mat-form-field>
        <br>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3422" name="v3422" placeholder="工廠地址" [readonly]="ReadOnly">
        </mat-form-field>
        <br>
        <mat-form-field>
            <input matInput [(ngModel)]="data.v3423" name="v3423" placeholder="備註" [readonly]="ReadOnly">
        </mat-form-field>
    </form>
</div>


<div mat-dialog-actions>
        <button mat-raised-button color="primary" (click)="onNoClick()">取消</button>
        <button mat-raised-button color="primary" (click)="onYesClick(data)" [disabled]="!VendorForm.valid" [hidden]="isModified">確定新增</button>
        <button mat-raised-button color="primary" (click)="ReadOnly=!ReadOnly;" [hidden]="!(this.isModified && this.ReadOnly)">修改</button>
        <button mat-raised-button color="primary" (click)="onPutClick(data)" [disabled]="!VendorForm.valid" [hidden]="!(this.isModified && !this.ReadOnly)">確定</button>
        <b *ngIf="(this.isModified && !this.ReadOnly)" style="color: red;vertical-align: middle">目前為編輯狀態！</b>
</div>